package com.olclass.web.domain;

import java.io.Serializable;
import java.util.List;
import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

@Entity
@Table(name = "lessonmedia" )
public class Lessonmedia  implements Serializable {

  private static final long serialVersionUID =  3985785900832330363L;

  @Id
      @GenericGenerator(name="idGenerator", strategy="uuid2")
    @GeneratedValue(generator="idGenerator")
  @Column(name = "id" )
  private String id;

  @Column(name = "name" )
  private String name;

  @Column(name = "url" )
  private String url;

  @Column(name = "description" )
  private String desc;

  @Column(name = "userid" )
  private String userid;

  @Column(name = "date" )
  private String date;

  @Column(name = "lessonid" )
  private String lessonid;

  @Column(name = "filesize" )
  private Long filesize;

	/**
	 * 0照片1视频2pdf3其他如zip
	 */
  @Column(name = "type" )
  private Integer type;


  @OneToOne(fetch= FetchType.EAGER)
  @JoinColumn(name = "userid", insertable = false, updatable = false)
  @NotFound(action = NotFoundAction.IGNORE)
  private User user;

  public User getUser() {
    return user;
  }

  public void setUser(User user) {
    this.user = user;
  }

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }
public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getUrl() {
    return url;
  }

  public void setUrl(String url) {
    this.url = url;
  }

  public String getDesc() {
    return desc;
  }

  public void setDesc(String desc) {
    this.desc = desc;
  }

  public String getUserid() {
    return userid;
  }

  public void setUserid(String userid) {
    this.userid = userid;
  }

  public String getDate() {
    return date;
  }

  public void setDate(String date) {
    this.date = date;
  }

  public String getLessonid() {
    return lessonid;
  }

  public void setLessonid(String lessonid) {
    this.lessonid = lessonid;
  }

  public Long getFilesize() {
    return filesize;
  }

  public void setFilesize(Long filesize) {
    this.filesize = filesize;
  }

  public Integer getType() {
    return type;
  }

  public void setType(Integer type) {
    this.type = type;
  }

}
